set(ST_HAL_FOUND true)
set(ST_HAL_INCLUDE_DIRS
    ${CMAKE_MODULE_PATH}/example/Core/Inc
    ${CMAKE_MODULE_PATH}/example/Drivers/STM32F4xx_HAL_Driver/Inc
    ${CMAKE_MODULE_PATH}/example/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy
    ${CMAKE_MODULE_PATH}/example/Middlewares/Third_Party/FreeRTOS/Source/include
    ${CMAKE_MODULE_PATH}/example/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS
    ${CMAKE_MODULE_PATH}/example/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F
    ${CMAKE_MODULE_PATH}/example/Drivers/CMSIS/Device/ST/STM32F4xx/Include
    ${CMAKE_MODULE_PATH}/example/Drivers/CMSIS/Include
)

set(ST_HAL_SRCS
    ${CMAKE_MODULE_PATH}/example/Core/Src/main.c
    ${CMAKE_MODULE_PATH}/example/Core/Src/gpio.c
    ${CMAKE_MODULE_PATH}/example/Core/Src/freertos.c
    ${CMAKE_MODULE_PATH}/example/Core/Src/usart.c
    ${CMAKE_MODULE_PATH}/example/Core/Src/stm32f4xx_it.c
    ${CMAKE_MODULE_PATH}/example/Core/Src/stm32f4xx_hal_msp.c
    ${CMAKE_MODULE_PATH}/example/Core/Src/stm32f4xx_hal_timebase_tim.c
    ${CMAKE_MODULE_PATH}/example/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c
    ${CMAKE_MODULE_PATH}/example/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c
    ${CMAKE_MODULE_PATH}/example/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c
    ${CMAKE_MODULE_PATH}/example/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c
    ${CMAKE_MODULE_PATH}/example/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c
    ${CMAKE_MODULE_PATH}/example/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c
    ${CMAKE_MODULE_PATH}/example/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c
    ${CMAKE_MODULE_PATH}/example/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c
    ${CMAKE_MODULE_PATH}/example/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c
    ${CMAKE_MODULE_PATH}/example/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c
    ${CMAKE_MODULE_PATH}/example/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c
    ${CMAKE_MODULE_PATH}/example/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c
    ${CMAKE_MODULE_PATH}/example/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c
    ${CMAKE_MODULE_PATH}/example/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c
    ${CMAKE_MODULE_PATH}/example/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c
    ${CMAKE_MODULE_PATH}/example/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c
    ${CMAKE_MODULE_PATH}/example/Core/Src/system_stm32f4xx.c
    ${CMAKE_MODULE_PATH}/example/Middlewares/Third_Party/FreeRTOS/Source/croutine.c
    ${CMAKE_MODULE_PATH}/example/Middlewares/Third_Party/FreeRTOS/Source/event_groups.c
    ${CMAKE_MODULE_PATH}/example/Middlewares/Third_Party/FreeRTOS/Source/list.c
    ${CMAKE_MODULE_PATH}/example/Middlewares/Third_Party/FreeRTOS/Source/queue.c
    ${CMAKE_MODULE_PATH}/example/Middlewares/Third_Party/FreeRTOS/Source/stream_buffer.c
    ${CMAKE_MODULE_PATH}/example/Middlewares/Third_Party/FreeRTOS/Source/tasks.c
    ${CMAKE_MODULE_PATH}/example/Middlewares/Third_Party/FreeRTOS/Source/timers.c
    ${CMAKE_MODULE_PATH}/example/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c
    ${CMAKE_MODULE_PATH}/example/Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c
    ${CMAKE_MODULE_PATH}/example/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c
    ${CMAKE_MODULE_PATH}/example/Core/Src/sysmem.c
    ${CMAKE_MODULE_PATH}/example/Core/Src/syscalls.c    
    ${CMAKE_MODULE_PATH}/example/Core/Src/dma.c
)

set(ST_HAL_STARTUP_FILE ${CMAKE_MODULE_PATH}/example/startup_stm32f407xx.s)
set(ST_HAL_LINKER_SCRIPT ${CMAKE_MODULE_PATH}/example/stm32f407vgtx_flash.ld)

message("Found ST_HAL")